import * as req from '@/request';

export async function all() {
  return await req.get<API.ProductList>('/product/all');
}

export async function list(
  params?: { [key: string]: any },
  sorter?: { [key: string]: any },
  filter?: { [key: string]: any },
) {
  return req.postForm<API.ProductList>('/product/list', params, sorter, filter);
}

export async function add(data: { [key: string]: any }) {
  return req.postForm<API.Result>('/product/create', data);
}

export async function update(data: { [key: string]: any }) {
  return req.postForm<API.Result>('/product/update', data);
}
